package object;

public class Course {
    private String id;
    private String name;
    private String location;
    private String time;
    private Teacher teacher;

    public Course(String id, String name, String location, String time) {
        this.id = id;
        this.name = name;
        this.location = location;
        this.time = time;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "课程[编号:" + id + "，名称:" + name + "，地点:" + location + "，时间:" + time + "，授课教师=" + (teacher != null ? teacher.getName() : "无") + "]";
    }
}